package vo;

import java.util.List;
import java.util.NoSuchElementException;

import po.CollegePO;


public class CollegeListVO {
	private List<CollegePO> collegeList;

	public CollegeListVO(List<CollegePO> collegeList) {
		super();
		this.collegeList = collegeList;
	}
	public String getCollegeName(String collegeID) throws NoSuchElementException{
		CollegePO college = getCollege(collegeID);
		if(college == null){
			throw new NoSuchElementException();
		}
		return college.getCollegeName();
	}
	private CollegePO getCollege(String collegeID){
		for(CollegePO c : collegeList){
			if(c.getCollegeID().equals(collegeID)){
				return c;
			}
		}
		return null;
	}
}
